print('*' * 20)
try:
    print(a)
except:
    print('Exception occurred!')
print('-' * 20)

print('*' * 20)
try:
    print(a)
except NameError:
    print('NameError occurred!')
print('-' * 20)

print('*' * 20)
try:
    print(a)
except NameError as ex:
    print(f'NameError occurred! {ex!r}')
print('-' * 20)
